package com.own.component.store.core.util;

import com.own.constant.ConstantCommon;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;

/**
 * StoreKeyUtil
 *
 * @author chenxueli
 * @date 2022-07-08 09:17:00
 */
@Slf4j
public final class StoreKeyUtil {

    /**
     * 创建缓存key
     *
     * @param items 参数
     * @return key
     */
    public static String build(Serializable... items) {
        var builder = new StringBuilder();
        for (var item : items) {
            builder.append(item).append(ConstantCommon.REDIS_SEPARATE);
        }
        return builder.substring(0, builder.length() - 1);
    }

}
